package wypozyczalnia.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import wypozyczalnia.domain.Authorities;

 
@Repository
public class AuthoritiesDao extends GenericDao<Authorities>  {

    @Autowired 
    public AuthoritiesDao(SessionFactory sf) {
        super(Authorities.class, sf);
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<Authorities> getAll() {
        return getHibernateTemplate().find("from User user order by user.username");
    }
}
